/**
 * ClientType.java 
 * Copyright © 2015-3015, 杭州泊享网络科技有限公司
 * 
 * @author Liu Tao
 * @create 2013年8月25日
 */
package com.pshare.enums;


/**
 * 客户端系统类型
 */
public enum OsType {
	
	IOS(1, "iOS"), ANDROID(2, "Android"), WP(3, "Windows Phone"), BLACKBERRY(4, "Black Berry"), WEB(9, "Web");

	private Integer code;
	private String name;

	private OsType(Integer code, String name) {
		this.code = code;
		this.name = name;
	}
	
	public static Boolean codeOf(int code) {
		for (OsType em : OsType.values()) {
			if (em.getCode() == code) {
				return true;
			}
		}
		return false;
	}
	
	public static String getName(int code) {
		for (OsType em : OsType.values()) {
			if (em.getCode() == code) {
				return em.getName();
			}
		}
		return "";
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
